package com.lostad.app.core.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lostad.app.core.dao.UserDao;
import com.lostad.app.core.domain.AppUser;
import com.lostad.app.core.domain.AppUser;

@Service
@Transactional
public class AppUserService {
	@Autowired
    private UserDao userDao;


    public List<AppUser> findAll(){
        List<AppUser> AppUsers = new ArrayList<>();

        for (AppUser AppUser : userDao.findAll()) {
            AppUsers.add(AppUser);
        }
        return AppUsers;
    }

    public void save(AppUser AppUser){
    	userDao.save(AppUser);
    }

    public void delete(String id){
    	userDao.delete(id);
    }

    public AppUser findAppUser(String id){
        return userDao.findOne(id);
    }
}
